/* === v-button === */

.v-button {
  font-family: inherit;
  display: inline-block;
  box-sizing: border-box;
  -webkit-appearance: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: @font-size-base;
  line-height: 1;
  padding: 10px 15px;
  margin: 0;
  outline: 0;
  border-radius: @button-radius;
  position: relative;
  border: none;
  cursor: pointer;
  color: #ffffff;
  background: @button-default;
  text-align: center;

  +.v-button {
    margin-left: 10px;
  }

  // mixins
  @val: 20;
  .color-btn (@type) {
    background: @type;
    &.v-button--outline {
      border: 1px solid @type;
      background: none;
      color: @type;
      &:not(.v-button--disabled):hover,
      &:not(.v-button--disabled):focus {
        color: @type + @val;
        background: none;
        border-color: @type + @val;
      }
      &:not(.v-button--disabled):active {
        color: @type - @val;
        background: none;
        border-color: @type - @val;
      }
    }
    &:hover,
    &:focus {
      background: @type + @val;
    }
    &:active {
      background: @type - @val;
    }
  }
  .color-btn(@button-primary);
  // colors button
  &--primary {
    .color-btn(@button-primary);
  }
  &--success {
    .color-btn(@button-success);
  }
  &--info {
    .color-btn(@button-info);
  }
  &--warning {
    .color-btn(@button-warning);
  }
  &--danger {
    .color-btn(@button-danger);
  }

  // size
  &--large {
    font-size: 17px;
    padding: 12px 15px;
  }
  &--small {
    font-size: 13px;
    padding: 8px 15px;
  }

  // style
  &--round {
    border-radius: 28px;
  }
  &--outline {
    border: 1px solid @button-default;
    background: none;
    color: @button-default;
    &.v-button--disabled {
      background: none;
      color: @disabled-color;
      border: 1px solid @disabled-color;
    }
  }
  &--disabled {
    background: @disabled-bg;
    color: @disabled-color;
    border: 1px solid @disabled-color;
    cursor: not-allowed;
  }

  // 文字按钮
  &--text {
    border: none;
    color: @button-default;
    background: transparent;
    padding-left: 0;
    padding-right: 0;
    &:hover,
    &:focus {
      background: transparent;
      color: @button-default + @val;
    }
    &.v-button--disabled {
      background: none;
      color: @disabled-color;
      border: none;
    }
  }
}

.v-button-group {
  display: inline-block;
  .v-button {
    border-radius: 0 0 0 0;
    border-left-width: 1px;
    border-left-color: hsla(0,0%,100%,.5);
    border-left-style: solid;
    flex: 1;
    margin: 0;
    float: left;
  }
  .v-button:first-child {
    border-radius: @button-radius 0 0 @button-radius;
    border-left-width: 0;
  }
  .v-button:last-child {
    border-radius: 0 @button-radius @button-radius 0;
  }
  .v-button:first-child:last-child {
    border-radius: @button-radius;
  }
  .v-button.v-button--round:first-child {
    border-radius: 27px 0 0 27px;
  }
  .v-button.v-button--round:last-child {
    border-radius: 0 27px 27px 0;
  }
}
